<!DOCTYPE html>
<html>
<head>
	<meta charset="utf8">
	<title>baidu sample | Angulartics</title>
	<link rel="stylesheet" href="//bootswatch.com/cosmo/bootstrap.min.css">

	<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
	<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular-route.min.js"></script>
	<script src="../src/angulartics.js"></script>
	<script src="../src/angulartics-baidu.js"></script>
</head>
<body ng-app="sample">

<div class="navbar navbar-default">
	<div class="navbar-header">
		<a class="navbar-brand" href="#/">My App</a>
	</div>
	<div>
		<ul class="nav navbar-nav">
			<li><a href="#/a">Page A</a></li>
			<li><a href="#/b">Page B</a></li>
			<li><a href="#/c">Page C</a></li>
		</ul>
	</div>
</div>

<div class="container">
	<div ng-view></div>
	<hr>

	<button analytics-on="click" analytics-category="Commands" analytics-action="Button 1"  class="btn btn-default">Button 1</button>

	<!-- same as analytics-on="click", because 'click' is the default -->
	<button analytics-on analytics-category="Commands" analytics-action="Button 2" analytics-label="Lable2" class="btn btn-primary">Button 2</button>

	<!-- same as analytics-event="Button 3", because is inferred from innerText -->
	<button analytics-on analytics-category="Commands" analytics-action="Button 3"  analytics-label="Button3 label"  analytics-value="1" class="btn btn-success">Button 3</button>

	<button analytics-on analytics-category="Commands" analytics-action="Button 4"  analytics-value="4" class="btn btn-info">Button 4</button>
	<hr>

	<p class="alert alert-success">
		Open the network inspector in your browser, click any of the nav options or buttons above and you'll see the analytics
		request being executed. Then check <a class="alert-link" href="http://tongji.baidu.com">your Baidu dashboard</a>.
	</p>
</div>

<script>
	angular.module('sample', ['ngRoute', 'angulartics', 'angulartics.baidu'])
	.config(function ($routeProvider, $analyticsProvider) {
		$routeProvider
			.when('/', { templateUrl: 'partials/root.tpl.html' })
	  	.when('/a', { templateUrl: 'partials/a.tpl.html' })
		  .when('/b', { templateUrl: 'partials/b.tpl.html' })
		  .when('/c', { templateUrl: 'partials/c.tpl.html' })
		  .otherwise({ redirectTo: '/' });
	});
</script>

<script>
var _hmt = _hmt || [];
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + 
"hm.baidu.com/h.js?9a8165957577a6ae1246440c1ce9ac21' type='text/javascript'%3E%3C/script%3E"));
</script>
</html>
